#pragma once
#include "DlgReg.h"

class CDlgLogin : public CDialogImpl<CDlgLogin>, public CWinDataExchange<CDlgLogin>
{
public:
	enum { IDD = IDD_DLG_LOGIN };

	BEGIN_DDX_MAP(CDlgLogin)
		DDX_TEXT(IDC_EDIT_USER, m_strUser)
		DDX_TEXT(IDC_EDIT_PASS, m_strPass)
	END_DDX_MAP() 

	BEGIN_MSG_MAP(CDlgLogin)
		MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
		COMMAND_ID_HANDLER(IDOK, OnCloseCmd)
		COMMAND_ID_HANDLER(IDCANCEL, OnCloseCmd)
		COMMAND_HANDLER(IDC_OK, BN_CLICKED, OnBnClickedOk)
		COMMAND_HANDLER(IDC_CANCEL, BN_CLICKED, OnBnClickedCancel)
		COMMAND_HANDLER(IDC_REGISTER, BN_CLICKED, OnBnClickedRegister)
	END_MSG_MAP()

	LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
	LRESULT OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
	LRESULT OnBnClickedOk(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
	LRESULT OnBnClickedCancel(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
	LRESULT OnBnClickedRegister(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);

public:
	void OnLogon(BOOL bSuc, CString strInfo);

public:
	_CSTRING_NS::CString m_strUser;
	_CSTRING_NS::CString m_strPass;
	CDlgReg* m_pDlgReg;
};
